<!DOCTYPE html>

<html>

<head>
    <title></title>
    <script src='../vue.js'></script>
</head>

<body>
    <div id='example'>
        {{a}}
    </div>
    <script>
        var vm = new Vue({
            el: '#example',
            data: {
                a: 1
            },
            created: function () {
                // `this` 指向 vm 实例
                console.log('created: a is: ' + this.a)
            },
            updated: function () {
                // `this` 指向 vm 实例
                console.log('updated: a is: ' + this.a)
            },
            mounted: function () {
                // `this` 指向 vm 实例
                console.log('mounted: a is: ' + this.a)
            },
            destroyed: function () {
                // `this` 指向 vm 实例
                console.log('destroyed: a is: ' + this.a)
            }
        })
        // -> "a is: 1"
    </script>
</body>


</html>